<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!-- JSTL -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>我的成绩</title>

<!-- Required meta tags -->
<meta charset="utf-  8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">

<script src="layui/layui.js" charset="utf-8"></script>
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
<script src="js/jquery-2.0.3.js" type="text/javascript" charset="utf-8"></script>

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/css/bootstrap.min.css">

<!-- FontAwesome CSS -->
<link rel="stylesheet" href="css/css/font-awesome.min.css">

<!-- ElegantFonts CSS -->
<link rel="stylesheet" href="css/css/elegant-fonts.css">

<!-- themify-icons CSS -->
<link rel="stylesheet" href="css/css/themify-icons.css">

<!-- Swiper CSS -->
<link rel="stylesheet" href="css/css/swiper.min.css">

<!-- Styles -->
<link rel="stylesheet" href="style.css">

</head>
<style type="text/css">
.dropdown {
	display: inline-block;
}

.dropdown-content {
	display: none;
	position: absolute;
	background: transparent;
	min-width: 150px;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
}

.dropdown-content a {
	color: black;
	padding: 12px 16px;
	text-decoration: none;
	display: block;
}

.dropdown-content a:hover {
	color: #19c880;
}

.dropdown:hover .dropdown-content {
	display: block;
}
</style>
<body class="courses-page">
	<c:if test="${pd==null}">
			<!-- c:redirect 跳转到 UserServlet -->
			<c:redirect url="EmpScoreServlet?op=queryByEmpNo&empNo=${sessionScope.empNo}"></c:redirect>
		</c:if>


	<div class="page-header">
		<header class="site-header">
			<div class="top-header-bar">
				<div class="container-fluid"></div>
				<!-- .container-fluid -->
			</div>
			<!-- .top-header-bar -->

			<div class="nav-bar">
				<div class="container">
					<div class="row">
						<div class="col-9 col-lg-3">
							<div class="site-branding">
								<h1 class="site-title">
									<a href="Main.jsp" rel="home">Emp<span>Training</span></a>
								</h1>
							</div>
							<!-- .site-branding -->
						</div>
						<!-- .col -->

						<div
							class="col-3 col-lg-9 flex justify-content-end align-content-center">
							<nav
								class="site-navigation flex justify-content-end align-items-center">
								<ul
									class="flex flex-column flex-lg-row justify-content-lg-end align-content-center">
									<li><a href="Main.jsp">我的主页</a></li>
									<li><a href="BeforeCourses.jsp">课程浏览</a></li>
									<li>
										<div class="dropdown" id="c1">
											<a href="EmpCourseApl.jsp" class="dropbtn"
												class="current-menu-item">我的课程 <span id="down1"
												class="fa fa-caret-down"
												style="margin-left: 10px; display: block;"></span> <span
												id="up1" class="fa fa-caret-up"
												style="margin-left: 10px; display: none;"></span>
											</a>
											<div class="dropdown-content">
												<a
													href="CCPTServlet?op=queryByEmp&empTel=${sessionScope.username}&applyState=0">申请中</a>
												<a
													href="CCPTServlet?op=queryByEmp&empTel=${sessionScope.username}&applyState=1">已通过</a>
												<a
													href="CCPTServlet?op=queryByEmp&empTel=${sessionScope.username}&applyState=2">未通过</a>
												
											</div>
										</div>
									</li>
									<li><a href="CourseEvaluation.jsp">课程评价</a></li>
									<li class="current-menu-item"><a href="EmpScoreBefore.jsp">我的成绩</a></li>
									<li>
										<div class="dropdown">
											<a href="EmpInfo.jsp" class="dropbtn">个人中心 <span
												id="down" class="fa fa-caret-down"
												style="margin-left: 10px; display: block;"></span> <span
												id="up" class="fa fa-caret-up"
												style="margin-left: 10px; display: none;"></span>
											</a>
											<div class="dropdown-content">
												<a href="EmpInfo.jsp">个人信息</a>
												<a href="#" id="Logout">退出登录</a>
											</div>
										</div>
									</li>
								</ul>

								
								<!-- .header-bar-search -->
							</nav>
							<!-- .site-navigation -->
						</div>
						<!-- .col -->
					</div>
					<!-- .row -->
				</div>
				<!-- .container -->
			</div>
			<!-- .nav-bar -->
		</header>
		<!-- .site-header -->

		<div class="page-header-overlay">
			<div class="container">
				<div class="row">
					<div class="col-12">
						<header class="entry-header">
							<h1>我的成绩</h1>

						</header>
						<!-- .entry-header -->
					</div>
					<!-- .col -->
				</div>
				<!-- .row -->
			</div>
			<!-- .container -->
		</div>
		<!-- .page-header-overlay -->
	</div>
	<!-- .page-header -->

	<div class="container">


		<section class="featured-courses horizontal-column courses-wrap">
			<div class="container">
				<div class="row">
					<div class="col-12">
						<header
							class="heading flex justify-content-between align-items-center">
							<h2 class="entry-title">我的成绩</h2>
						</header>
						<!-- .heading -->
					</div>
					<div style="position: absolute; right: 450px; top: 500px;">
						<span class="x-right" style="line-height: 40px">共有数据：<span
							class="layui-badge">${pd.totalCount}</span> 条
						</span>
						

					</div>
					<div style="position: absolute; right: 300px; top: 500px;">
						
						显示：<select id="pass" name="pass" id="pass" lay-verify="required"
							class="layui-select">
							<option value="">全部</option>
							<option value="1">已通过</option>
							<option value="0">未通过</option>
						</select>

					</div>
					<!-- 判断是否为空 -->
					<c:if test="${pd!=null}">
						<!-- 遍历 -->
						<c:forEach items="${pd.data}" var="EmpScore">
							<!-- .col -->
							<div class="col-12 col-lg-8" style="margin-left: 150px;">
								<div
									class="course-content flex flex-wrap justify-content-between align-content-lg-stretch">
									<figure class="course-thumbnail">
										<a href="#"><img src="${EmpScore.coursePic}"></a>
										<!-- 课程图片 -->
									</figure>
									<!-- .course-thumbnail -->

									<div class="course-content-wrap">
										<header class="entry-header">


											<h3>
												<a>${EmpScore.courseName}</a>
											</h3>
											<h2 class="entry-title">
												<a>教员：${EmpScore.teacherName}</a>
											</h2>


											<!-- .course-date -->

											<h2 class="entry-title">成绩：${EmpScore.score}</h2>
											<h2 class="entry-title">
												是否通过：
												<c:if test="${EmpScore.pass==1}">
													<span class="layui-btn layui-btn-normal ">已通过</span>
												</c:if>
												<c:if test="${EmpScore.pass==0}">
													<span class="layui-btn layui-btn-danger "> 未通过 </span>
												</c:if>
											</h2>
											<h2 class="entry-title">评语：${EmpScore.notes}</h2>
										</header>
										<!-- .entry-header -->


									</div>
									<!-- .course-content-wrap -->
								</div>
								<!-- .course-content -->
							</div>
							<!-- .col -->
						</c:forEach>
					</c:if>
				</div>

				<!-- .row -->
				<input type="hidden" id="p1" name="pass"
					value="<%=request.getAttribute("pass")%>">
			</div>
			<div id="page" style="position: relative; left: 165px; top: 40px;"></div>
			<!-- .container -->
		</section>
		<!-- .courses-wrap -->
		<footer class="site-footer">
		<div class="footer-widgets">
			<div class="container">
				<div class="row">
					<div class="col-12 col-md-6 col-lg-3">
						<h2 class="w-100">版权</h2>
						<div class="foot-about">
							<p class="footer-copyright">版权所有:bug总和我作队</p>
						</div>
						<!-- .foot-about -->
					</div>
					<!-- .col -->
					<div class="col-12 col-md-6 col-lg-3 mt-5 mt-md-0">
						<div class="foot-contact">
							<h2>联系我们</h2>

							<ul>
								<li>电子邮件：1727283192@qq.com</li>
								<li>电话：17606064136</li>
								<li>地址：福建省厦门市</li>
							</ul>
						</div>
						<!-- .foot-contact -->
					</div>
					<!-- .col -->

					<div class="col-12 col-md-6 col-lg-3 mt-5 mt-lg-0">
						<div class="quick-links flex flex-wrap">
							<h2 class="w-100">快速连接</h2>

							<ul class="w-50">
								<li><a href="about.html">关于 </a></li>
								<li><a href="#">使用条款</a></li>
								<li><a href="#">隐私政策 </a></li>
								<li><a href="#">联系我们</a></li>
							</ul>

						</div>
						<!-- .quick-links -->
					</div>
					<!-- .col -->

					<div class="col-12 col-md-6 col-lg-3 mt-5 mt-lg-0">
						<div class="follow-us">
							<h2>关注我们的动向</h2>
							<img src="images/erweima.png">
						</div>
						<!-- .quick-links -->
					</div>
					<!-- .col -->
				</div>
				<!-- .row -->
			</div>
			<!-- .container -->
		</div>
		<!-- .footer-widgets -->
		<input type="hidden" value="${sessionScope.empNo}" id="getempNo">
	</footer>
	</div>
	<!-- .container -->
	<script type="text/javascript">
	var empNo = $("#getempNo").val();
	var p1 = $("#p1").val();
	$("#pass").val(p1);
	$("#pass").change(function(){
		var p = $("#pass").val();
		location.href = "EmpScoreServlet?op=queryByEmpNo&pass="+p+"&empNo="+empNo;
	});
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage,
		  layer = layui.layer;
		  
		laypage.render({
			elem : 'page',
			theme:'#00BFFF',
			count : ${pd.totalCount},//数据总数，从服务端得到
			curr:${pd.page},//得到当前页，以便向服务端请求对应页的数据。
			limit:${pd.pageSize},//得到每页显示的条数
			layout : [ 'prev', 'page', 'next',  ],
			jump : function(obj,first) {
				
				 //obj包含了当前分页的所有参数，
				//首次不执行
			    if(!first){
			    	location.href = "EmpScoreServlet?op=queryByEmpNo&page="
						+ obj.curr+"&pageSize="+obj.limit;
			    }
			}
		});
	});
	</script>
	<!--退出登录-->
	<script>
		layui.use([ 'layer' ],function() {
			$ = layui.jquery;//jquery
			layer = layui.layer;//弹出层
			$("#Logout").click(function() {
					layer.confirm('确认要退出登录吗？',function(index) {
						$.ajax({
							url : "LoginServlet",
							type : "get",
							data : {
								op1:"logout"
							},
							success : function(data) {
								if (data.code == 1) {
									location.href = "http://localhost:8080/EmpTrainingTest/Login.jsp";
									return false;
								} 
							},
							dataType : "json"
						});	
					});
				});
			});
	</script>

	<script type='text/javascript' src='js/js/jquery.js'></script>
	<script type='text/javascript' src='js/js/swiper.min.js'></script>
	<script type='text/javascript' src='js/js/masonry.pkgd.min.js'></script>
	<script type='text/javascript' src='js/js/jquery.collapsible.min.js'></script>
	<script type='text/javascript' src='js/js/custom.js'></script>


</body>
</html>